package com.twu.biblioteca;

public class User {
    private String name;
    private String emailAddress;
    private String phoneNumber;

    public User(String name, String emailAddress, String phoneNumber) {
        this.name = name;
        this.emailAddress = emailAddress;
        this.phoneNumber = phoneNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (!emailAddress.equals(user.emailAddress)) return false;
        if (!name.equals(user.name)) return false;
        if (!phoneNumber.equals(user.phoneNumber)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name.hashCode();
        result = 31 * result + emailAddress.hashCode();
        result = 31 * result + phoneNumber.hashCode();
        return result;
    }

    public String getName() {
        return name;
    }

    public String getEmailAddress() {
        return emailAddress;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public String getUserInformation() {
        String userInformation = getName()+" "+getEmailAddress()+" "+getPhoneNumber();
        return userInformation;
    }

}
